<template>
  <div class="config_odu_ctp">
<!--    <el-header style="background-color: #1bdb35">Odu CTP 配置</el-header>-->
    <el-form :model="odu" ref="ruleForm" label-width="150px" class="config_form">
      <el-row>
        <el-col :span="11">
          <el-form-item label="净荷类型" prop="oduSignalType">
            <el-select v-model="odu.oduSignalType" clearable
                       placeholder="请选择类型">
              <el-option
                  v-for="(i,index) in xc_clientSignalType"
                  :key="index"
                  :value="i">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="适配类型" prop="adaptationType">
            <el-select v-model="odu.adaptationType" clearable
                       placeholder="请选择类型">
              <el-option
                  v-for="(i,index) in adaptationType"
                  :key="index"
                  :value="i">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="交换能力" prop="switchCapability">
            <el-select v-model="odu.switchCapability" clearable
                       placeholder="请选择类型">
              <el-option
                  v-for="(i,index) in xc_switchType"
                  :key="index"
                  :value="i">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="PM 实际发送开销">
            <el-input v-model="odu.pMTrailTraceActualTx"></el-input>
          </el-form-item>
          <el-form-item label="PM 期望接收开销">
            <el-input v-model="odu.pMTrailTraceExpectedRx"></el-input>
          </el-form-item>

          <el-form-item label="时延测试">
            <el-switch
                v-model="odu.oduDelayEnable"
                active-color="#13ce66"
                inactive-color="#ff4949">
            </el-switch>
          </el-form-item>
        </el-col>
        <el-col :span="2">

        </el-col>
        <el-col :span="11">
          <div>
            <el-form-item label="时隙">
              <el-input v-model="odu.tsDetail" readonly></el-input>
            </el-form-item>
            <el-form-item label="GFP中ODU0数量">
              <el-input v-model="odu.currentNumberOfTributarySlots" readonly></el-input>
            </el-form-item>

            <el-form-item label="G.Hao调整状态">
              <el-input v-model="odu.gHaoStatus" readonly></el-input>
            </el-form-item>


            <el-form-item label="PM 实际接收开销">
              <el-input v-model="odu.pMTrailTraceActualRx"></el-input>
            </el-form-item>

            <div v-show="odu.oduDelayEnable">
              <el-form-item label="双向时延值">
                <el-input v-model="odu.oduDelayPerformance.delay" readonly></el-input>
              </el-form-item>
              <el-form-item label="结束时间">
                <el-input v-model="odu.oduDelayPerformance.lastUpdateTime" readonly></el-input>
              </el-form-item>
            </div>
          </div>
        </el-col>
      </el-row>


      <el-form-item>
        <el-image
            style="width: 20px; height: 25px;"
            :src="require('@/assets/union_rule_font.jpg')"
            :preview-src-list="[require('@/assets/union/oduCtpPac.jpg')]">
        </el-image>
        <el-button type="primary" @click="submitForm('ruleForm')">确认</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
      </el-form-item>

    </el-form>
  </div>
</template>

<script>
import {xc_adaptationType, xc_clientSignalType, xc_switchType} from "@/assets/config/XcPac";

export default {
  name: "OduCtp",
  data() {
    return {
      xc_clientSignalType,
      adaptationType: xc_adaptationType,
      xc_switchType: xc_switchType,
      odu: {
        oduSignalType: '',
        adaptationType: '',
        switchCapability: '',
        tsDetail: '',
        currentNumberOfTributarySlots: '',

        pMTrailTraceExpectedRx: '',
        pMTrailTraceActualTx: '',
        pMTrailTraceActualRx: '',

        gHaoStatus: '',
        oduDelayEnable: true,
        oduDelayPerformance: {
          delay: '2.336',
          lastUpdateTime: '2022-6-16',
        }

      }
    }
  },
  props: ['node', 'ptp'],
}
</script>

<style scoped>

</style>